<?php
$this->headLink()->appendStylesheet($this->baseUrl().'/css/printing.css');
$currency = new Zend_Currency();
$date = new Zend_Date();
if($this->data)
{
	foreach($this->data as $invoice)
	{
?>
		<div class="invoice">
			<h3>Invoice</h3>
			<div class="seller-address">
				Susan Parry<br />
				Old School House<br />
				Queen Street<br />
				Eastrington<br />
				Goole<br />
				DN147QA<br />
			</div>
			<br class="clear" />
			<div class="buyer-address">
				<b><?= $invoice['buyer']['name'] ?></b><br />
				<?= $invoice['buyer']['street'] ?><br />
				<?= $invoice['buyer']['city'] ?><br />
				<?= $invoice['buyer']['province'] ?><br />
				<?= $invoice['buyer']['postcode'] ?><br />				
			</div>
			<div class="details">
				<b><?php echo $date->get(Zend_Date::DATE_LONG);?></b>
			</div>
			<br class="clear" />
			<div class="transaction">
				<table class="items">
				<tr><th class="itemId">Item Number</th><th>Item Title</th><th class="total">Price</th></tr>
				<?php 
					$order =  "<tr>";
					$order .= "<td class=\"itemId\">" . $invoice['transaction']['ebayId'] . "</td>";
					$order .= "<td>" . $invoice['item']['title'] . "</td>";
					$order .= "<td class=\"total\">" . $currency->toCurrency($invoice['transaction']['sale']) . "</td>";
					$order .= "</tr>\n";
					echo $order;
				?>
				</table>
				<table class="total">
				<tr><td>Subtotal:</td><td class="total"><?php echo $currency->toCurrency($invoice['transaction']['sale']);?></td></tr>
				<tr><td>Postage and packaging</td><td class="total"></td></tr>
				<tr><td>Total:</td><td class="total totalAll"><?php echo $currency->toCurrency($invoice['transaction']['sale']); ?></td></tr>
				</table>
			</div>
		</div>
<?
	}
}
else
{
	echo 'There are no details that can be printed';
}

?>